package cn.com.guage.single.badmash;

/**
 * 恶汉模式 静态变量方式实现
 * 
 * @author yangdechao
 *
 */
public class Singleton1 {

	private final static Singleton1 instance = new Singleton1();

	public Singleton1() {
	}

	public static Singleton1 getInstance() {
		return instance;
	}

	public void say() {
		System.out.println("say");
	}

	public static void main(String[] args) {
		Singleton1 instance1 = Singleton1.getInstance();
		System.out.println(instance1);
		instance.say();
		Singleton1 instance2 = Singleton1.getInstance();
		System.out.println(instance2);
	}

}
